<template>
	<view class="container">
		<view class="box">
			<uni-list>
				<uni-list-item title="注册协议" link to="./agreement"></uni-list-item>
				<uni-list-item title="关于我们" link to="./about"></uni-list-item>
			</uni-list>
		</view>
		<view class="box"><van-button type="default" block @click="logout">退出登录</van-button></view>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定要退出登录吗？" @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
export default {
	data() {
		return {}
	},
	methods: {
		logout() {
			this.$refs.alertDialog.open()
		},
		dialogConfirm() {
			this.$store.dispatch("logout").then(res => {
				uni.navigateBack()
			})
		},
		dialogClose() {
			console.log('点击关闭')
		}
	}
}
</script>

<style lang="scss" scoped>
::v-deep .van-button--default {
	color: #07C160;
}
</style>
